﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kooboo.Commerce.Common;

namespace Kooboo.Commerce
{
    public static class ICustomerAction
    {
        public static string FullName(this ICustomer customer)
        {
            if (customer == null)
            {
                return string.Empty;
            }
            else
            {
                return string.Format("{0} {1} {2}", customer.FirstName, customer.MiddleName, customer.LastName);
            }
        }

        #region Address

        public static void Post(this ICustomer customer, IAddress address)
        {
            AddressFactory.Post(customer.Id, address);
        }

        public static void Put(this ICustomer customer, IAddress address)
        {
            AddressFactory.Put(customer.Id, address);
        }

        public static void Delete(this ICustomer customer, IAddress address)
        {
            AddressFactory.Delete(customer.Id, address);
        }

        #endregion
    }
}
